var rootPath = getRootPath();

$(function() {
	$("#save").click(function(){
		var sid = $("#sid").html();
		var duid = $("#duid").val();
		if(sid == "" || duid == "") {
			layer.alert("请选择绑定的梦想中心主任");
			return;
		}
		$.ajax({
			url : rootPath + "/school/reBindCurDirector",
			method : "POST",
			contentType: 'application/json;charset=UTF-8',
			data : JSON.stringify({
				"sid" : sid,
				"duid" : duid,
				"state" : 2,
				"dr" : 1
			}),
			success : function(data) {
				if(data.returnCode == '0000') {
					layer.msg("保存成功",{time:1000,icon:6});
				} else {
					layer.alert(data.returnMessage);
				}
			},
			error: function (jqXHR, textStatus, errorThrown) {
				layer.alert("error");
			}
		});
	});
});